<template>
  <div>
    <div class="table_head">
      <div class="head_l">详细数据</div>
      <div class="head_r">
        <export-excel-button title="销售金额统计" action="/sales/analysis/list/export" :params="ExportParams" />
      </div>
    </div>
    <el-table ref="table" v-loading="loading" :data="dataList" stripe border>
      <el-table-column label="日期" align="center" prop="createDate" :show-overflow-tooltip="true" />
      <el-table-column label="销售订单数" align="center" prop="ordersCount" :show-overflow-tooltip="true" />
      <el-table-column label="实付金额" align="center" prop="paidInAmount" :show-overflow-tooltip="true" />
      <el-table-column label="支付人数" align="center" prop="payerCount" :show-overflow-tooltip="true" />
      <el-table-column label="退款笔数" align="center" prop="refundsCount" :show-overflow-tooltip="true" />
      <el-table-column label="退款金额" align="center" prop="refundsAmount" :show-overflow-tooltip="true" />
      <el-table-column label="退款人数" align="center" prop="refundsPersonCount" :show-overflow-tooltip="true" />
      <!-- <el-table-column label="订单来源" align="center" prop="orderSource" :show-overflow-tooltip="true" width="100">
                    <template slot-scope="scope">
                        <dict-tag :options="orderSourceLs" :value="scope.row.orderSource" />
                    </template>
                </el-table-column> -->
    </el-table>

    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
      @pagination="getList" :autoScroll="false"></pagination>
  </div>
</template>

<script>
import {
  salesStatisticalData
} from "@/api/merchants/salesAnalysis";
import ExportExcelButton from "@/components/ExportExcelButton/index";
export default {
  name: 'tableData',
  components: {
    ExportExcelButton,
  },
  data() {
    return {
      dataList: [], //数据列表
      loading: false,
      total: 0,//状态字典数组
      childQuery:{},
      queryParams: {
        pageNum: 1,
        pageSize: 10,
      },
    };
  },
  created() {
    //  this.getList()
  },
  computed: {
    ExportParams() {
      const params = {
        ...this.queryParams,
        ...this.childQuery
      };
      return params;
    },
  },
  mounted() { },
  methods: {
    /** 查询列表 */
    getList() {
      this.loading = true;
      var data = {
        ...this.queryParams,
        ...this.childQuery
      }
      salesStatisticalData(data).then((response) => {
        // console.log('response.result.records',response.result.records)
        this.dataList = response.result.records;
        this.total = response.result.total;
        this.loading = false;
      });
    },

  },
};

</script>

<style lang="scss" scoped>
.table_head {
  font-size: 18px;
  font-weight: bold;
  padding-bottom: 20px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}
</style>
